package com.xuanwu.ai.flow.sao;


import com.alibaba.fastjson.JSONObject;
import com.xuanwu.ai.flow.sao.req.*;
import com.yomahub.liteflow.script.annotation.ScriptBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(url = "${ai.detect.url}", value = "AIDetectSao")
public interface AIDetectSao {

    /**
     * AI鉴权
     *
     * @param authReq
     * @return
     */
    @PostMapping(value = "/auth/login", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject aiAuth(@RequestBody AuthReq authReq);


    /**
     * SKU识别
     *
     * @param token
     * @param skuDetectReq
     * @return
     */
    @PostMapping(value = "/shelf/syncdetect", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject skuDetect(@RequestHeader("token") String token, @RequestBody SkuDetectReq skuDetectReq);


    /**
     * 翻拍识别
     *
     * @param token
     * @param fakePhotoDetectReq
     * @return
     */
    @PostMapping(value = "/imagequality/fakephoto", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject fakePhotoDetect(@RequestHeader("token") String token, @RequestBody FakePhotoDetectReq fakePhotoDetectReq);


    /**
     * 模糊识别
     *
     * @param token
     * @param blurDetectReq
     * @return
     */
    @PostMapping(value = "/imagequality/blurdetect", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject blurDetect(@RequestHeader("token") String token, @RequestBody BlurDetectReq blurDetectReq);


    /**
     * 店头场景识别
     *
     * @param token
     * @param storePlaceDetectReq
     * @return
     */
    @PostMapping(value = "/scene/storedetect", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject storePlaceDetect(@RequestHeader("token") String token, @RequestBody StorePlaceDetectReq storePlaceDetectReq);


    /**
     * 陈列场景识别
     *
     * @param token
     * @param displayPlaceDetectReq
     * @return
     */
    @PostMapping(value = "/scene/displaydetect", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject displayPlaceDetect(@RequestHeader("token") String token, @RequestBody DisplayPlaceDetectReq displayPlaceDetectReq);

    /**
     * 拼接预测
     *
     * @param token
     * @param mergePredictionReq
     * @return
     */
    @PostMapping(value = "/merge/mergeprediction", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject mergePrediction(@RequestHeader("token") String token, @RequestBody MergePredictionReq mergePredictionReq);

    /**
     * 图片拼接
     *
     * @param token
     * @param imageSpliceReq
     * @return
     */
    @PostMapping(value = "/merge/spliceimage", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject imageSplice(@RequestHeader("token") String token, @RequestBody ImageSpliceReq imageSpliceReq);

    /**
     * 图片拼接（含sku识别）
     *
     * @param token
     * @param imageMergeReq
     * @return
     */
    @PostMapping(value = "/merge/mergeimage", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject imageMerge(@RequestHeader("token") String token, @RequestBody ImageMergeReq imageMergeReq);

    /**
     * 地堆面积识别
     *
     * @param token
     * @param heapAreaDetectReq
     * @return
     */
    @PostMapping(value = "/heap/areadetect", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject heapAreaDetect(@RequestHeader("token") String token, @RequestBody HeapAreaDetectReq heapAreaDetectReq);

    /**
     * 地堆饱满度预估
     *
     * @param token
     * @param heapFullnessEstimateReq
     * @return
     */
    @PostMapping(value = "/heap/fullness", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject heapFullnessEstimate(@RequestHeader("token") String token, @RequestBody HeapFullnessEstimateReq heapFullnessEstimateReq);

    /**
     * 地堆箱体预估
     *
     * @param token
     * @param heapBoxEstimateReq
     * @return
     */
    @PostMapping(value = "/heap/forecast", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject heapBoxEstimate(@RequestHeader("token") String token, @RequestBody HeapBoxEstimateReq heapBoxEstimateReq);

    /**
     * 视频识别
     *
     * @param token
     * @param videoDetectReq
     * @return
     */
    @PostMapping(value = "/video/detect", consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject videoDetect(@RequestHeader("token") String token, @RequestBody VideoDetectReq videoDetectReq);
}
